extends Sprite

func _ready():
	
	pass

# 按下开始游戏
func _on_new_game_pressed():
	get_parent().main()
	queue_free()
	pass

# 按下继续游戏
func _on_continue_pressed():
	print(global.load_ezgal("ezgal",8))
	if global.load_ezgal("ezgal",9) != "":
		# 音频设置状态
		AudioServer.set_bus_volume_db(1,int(global.load_ezgal("ezgal",0)))
		AudioServer.set_bus_volume_db(2,int(global.load_ezgal("ezgal",1)))
		# 时钟周期
		get_parent().time_load = int(global.load_ezgal("ezgal",2))
		# 音乐, 场景与立绘设置
		get_parent().move_music(int(global.load_ezgal("ezgal",5).get_slice("[&]", 0)),global.load_ezgal("ezgal",5).get_slice("[&]", 1))
		get_parent().move_scene(global.load_ezgal("ezgal",6))
		if global.load_ezgal("ezgal",7) != "hide":
			get_parent().role_left.texture = load(global.load_ezgal("ezgal",7))
			get_parent().role_left.show()
		if global.load_ezgal("ezgal",8) != "hide":
			get_parent().role_right.texture = load(global.load_ezgal("ezgal",8))
			get_parent().role_right.show()
		# 对话状况
		global.dialog_data = global.load_ezgal("ezgal",9).split("[&]",false)
		
	else:
		print("无数据")
	get_parent().main()
	# gialog对话进行位置
	get_parent().the_dialog.now_text = int(global.load_ezgal("ezgal",3))
	get_parent().the_dialog.now_role = global.load_ezgal("ezgal",4)
	queue_free()
	pass

# 按下exit按钮
func _on_exit_pressed():
	get_tree().quit()
	pass


